Skip to content

fix(exec): reject empty command before executor setup#467

Open
not-matthias wants to merge 2 commits into
mainfrom
cod-3225-exec-empty-command-fail-fast
Open

fix(exec): reject empty command before executor setup#467
not-matthias wants to merge 2 commits into
mainfrom
cod-3225-exec-empty-command-fail-fast

Conversation

@not-matthias

@not-matthias not-matthias commented Jul 23, 2026

Copy link
Copy Markdown
Member

codspeed exec with no command — and codspeed run with an empty or whitespace-only exec config target — built a BenchmarkTarget::Exec with an empty command. That empty target survived the full orchestrator (memtrack install, eBPF/libc uprobe attach, exec-harness spawn) before exec-harness rejected it with Empty command in stdin input, surfaced at the top level as the cryptic failed to execute memory tracker process: exit status: 1 after a ~2.3s probe detach.

The command is only ever supplied at two origins, so each is now validated up front — before any setup work:

  • CLI (codspeed exec): the positional command is now clap-required, so a missing command fails immediately at arg-parse with a usage message.
  • Config (codspeed run): build_benchmark_targets bails when a config exec command parses to zero words, naming the offending target.

Fixes COD-3225

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown

Greptile Summary

Adds early validation for empty exec commands.

  • Requires a command when invoking codspeed exec.
  • Rejects missing, empty, and whitespace-only executables before orchestrator setup.
  • Adds focused tests for invalid executables and valid empty arguments.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failures remain.

Important Files Changed

Filename Overview
src/cli/exec/mod.rs Validates CLI and config-derived exec targets before executor initialization, fully addressing the previously reported empty and whitespace-only executable cases.

Reviews (3): Last reviewed commit: "fix(exec): reject whitespace-only execut..." | Re-trigger Greptile

Comment thread src/cli/exec/multi_targets.rs Outdated
@codspeed-hq

codspeed-hq Bot commented Jul 23, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 17 untouched benchmarks


Comparing cod-3225-exec-empty-command-fail-fast (825e87c) with main (26fb4b5)

Open in CodSpeed

`codspeed exec` with no command, and `codspeed run` with an empty or
whitespace-only `exec` target, built a BenchmarkTarget with an empty
command that only failed deep inside exec-harness ("Empty command in
stdin input"), surfaced as the cryptic "failed to execute memory
tracker process: exit status: 1" after a full memtrack probe attach.

Enforce a non-empty command at each origin: mark the exec positional
clap-required, and bail in build_benchmark_targets when a config exec
command parses to zero words.
@not-matthias
not-matthias force-pushed the cod-3225-exec-empty-command-fail-fast branch from 80723f5 to c4f262e Compare July 23, 2026 16:50
Comment thread src/cli/exec/mod.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant